/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Andre
 */
@Embeddable
public class ItenscompraPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "idCompra", nullable = false)
    private int idCompra;
    @Basic(optional = false)
    @NotNull
    @Column(name = "item", nullable = false)
    private int item;

    public ItenscompraPK() {
    }

    public ItenscompraPK(int idCompra, int item) {
        this.idCompra = idCompra;
        this.item = item;
    }

    public int getIdCompra() {
        return idCompra;
    }

    public void setIdCompra(int idCompra) {
        this.idCompra = idCompra;
    }

    public int getItem() {
        return item;
    }

    public void setItem(int item) {
        this.item = item;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCompra;
        hash += (int) item;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItenscompraPK)) {
            return false;
        }
        ItenscompraPK other = (ItenscompraPK) object;
        if (this.idCompra != other.idCompra) {
            return false;
        }
        if (this.item != other.item) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.ItenscompraPK[ idCompra=" + idCompra + ", item=" + item + " ]";
    }
    
}
